package face.pay.web.agency.enterprise.profit;

import face.pay.system.annotation.CurrentUser;
import face.pay.common.enterprise.service.IprofitBaseService;
import face.pay.entity.ProfitInfo;
import face.pay.entity.UserInfo;
import face.pay.util.ResultMessage;
import face.pay.util.page.PageData;
import face.pay.util.page.PageParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * @Auther: zkj
 * @Date: 2019/7/12 10:39
 * @Description:
 */
@Controller
@RequestMapping("/enterprise_profit")
public class ProfitController {

    @Autowired
    private IprofitBaseService iprofitService;

    @RequestMapping("/list")
    public String manager() {
        return "agency/enterprise/profit/profit_list";
    }

    @RequestMapping("/edit")
    @ResponseBody
    public ResultMessage editUser(@CurrentUser UserInfo loginUser, ProfitInfo profitInfo) {
        return iprofitService.modifyInfo(profitInfo, loginUser);
    }


    @RequestMapping("/queryData")
    @ResponseBody
    public PageData data(PageParam pageParam, @CurrentUser UserInfo loginUser) {
        return this.iprofitService.queryPage(loginUser, pageParam);
    }


}
